<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>私有云音乐播放器</title>
<!-- logo -->
<link rel="shortcut icon" href="img/LOGO.png" type="image/x-icon">
<!-- 引入外部css -->
<link rel="stylesheet" href="js/icheck-1.x/skins/all.css">
<!-- 导入jquery文件 -->
<script src="js/jquery-3.3.1.min.js"></script>
<!-- iCheck-1.x的复选框插件-->
<script src="js/icheck-1.x/icheck.min.js"></script>
<link rel="stylesheet" href="css/music.css">
<link rel="stylesheet"
	href="https://at.alicdn.com/t/font_845956_e6gmew3xp0c.css">
<style>
.bobo {
	position: absolute;
	top: 100%;
	left: 0;
	-moz-user-select: none;
	-webkit-user-select: none;
	user-select: none;
}
 /*addClass("addstyle")  remove("addstyle")*/
 .addstyle{line-height: 40px;top:1px !important;}
</style>
</head>
<!-- 引入外部js -->
<script type="text/javascript" src="js/signinform.js"></script>
<script type="text/javascript" src="js/finduserlists.js"></script>
<script type="text/javascript" src="js/addlikes.js"></script>
<script type="text/javascript" src="js/addcollects.js"></script>
<script type="text/javascript" src="js/signout.js"></script>

<!-- 判断是否登陆js -->
<script type="text/javascript">
	var isLogin=false;
	var userNameCurrent;
	var idLogin = {
			url : "music/user/isLogIn",
			data : {},
			dataType : "json",
			type : "post",
			success : function(data) { 
				isLogin=data.isLogin;
				if(isLogin==true){
					userNameCurrent=data.userName;
					$(".js_landing").show();
					$("#landingUser").css("display","none");
					findSongLists();
					// setTimeout(function(e){
					// 	findSongLists();
	                // },1800);
					//找寻用户拥有的歌单信息已经在每个歌曲列表初始化完成后调用
                    // 个人用户信息
					var personinfo = data.rows[0];
					$("#afterlogin_username").text(personinfo.nname);
					setTimeout(function(e){
						//将个人信息回显至个人信息页面
						$(".js_infonname span").html(personinfo.nname);
						$(".js_infousername span").html(personinfo.username);
						$(".js_infosex span").html(personinfo.sex);
						$(".js_infophone span").html(personinfo.phone);
						$(".js_infoemail span").html(personinfo.email);
					},500);

				}else{
                }
                $("#logindelete").hide();
			},
			error : function(data) {

			}
		};
	$.ajax(idLogin);
</script>
<body>
	<!-- home页面 -->
	<div class="player_main" style="z-index: 3" id="mainplayer">
		<!-- 头部 -->
		<div class="playernav_bar">
			<a class="playernav_bar_content playnav_username" href="javascript:;" id="landingUser">登录</a>
			<!-- 登录之后的模板 -->
			<div class="js_landing">
                <!--<img src="img/logo1.gif" alt="" width="30" height="30">-->
                <a class="tuichu playnav_username" href="javascript:signOut()">退出</a>
				<span id="afterlogin_username" class="playnav_username js_username" style="">Jack</span>
				<a class="playernav_bar_content"><i
					class="iconfont icon-touxiang"></i></a>
			</div>
		</div>
        <!--用户详细-->
        <div id="personinfo" class="personxiangxi js_userinfo" style="display: none;">
            <ul>
                <li><a href="javascript:;" class="js_pinfo">个人信息</a></li>
				<li><a href="http://moresound.tk/music/" target="_blank">摩声( • ̀ώ• )✧</a></li>
				<li><a href="javascript:;" class="js_changeuser">切换账号</a></li>
				<li><a href="javascript:;" class="js_changeuserpassword">修改密码</a></li>
				<li><a onmouseover="this.style.cssText='color:#FF363D;'" onmouseout="this.style.cssText='color:#828282'" href="javascript:;" class="js_banuser">用户注销</a></li>
				<li><a href="javascript:;" class="js_ploginout">退出登录</a></li>
            </ul>
        </div>
		<!-- 内容区 -->
		<div class="player_content">
			<div class="palyercon_left">
				<ul class="jsall_list js_palylistsong">
					<li class="left_li js_playall focus"><a href="javascript:;"
						class="js_leftlistall"><i class="iconfont icon-quanbu"></i><span>全部歌曲</span></a>
					</li>

					<li class="left_li js_playhistory"><a href="javascript:;"><i
							class="iconfont icon-lishi"></i><span>播放历史</span></a></li>

					<li class="left_li js_playmylover"><a href="javascript:;"><i
							class="iconfont icon-aixinkong"></i><span>我喜欢</span></a></li>

					<li class="left_li js_playcollection"><a href="javascript:;"><i
							class="iconfont icon-shoucang"></i><span>我的收藏</span></a></li>
				</ul>
				<div class="hr"></div>
				<div class="song_sheet">
					<span>我创建的歌单</span> <a href="javascript:;" class="f_r js_songsheet"
						draggable="false"><i class="iconfont icon-jiahaotianjia"></i></a>
				</div>
				<ul class="js_songlist songlist_main"></ul>
			</div>
			<div class="palyercon_right">
				<!-- 编辑区 -->
				<div class="palyercon_right_tool">
					<a href="javascript:;" id="shangchuancopyban"> <i
						class="iconfont icon-shangchuancopyban"></i> <span>上传歌曲</span>
					</a> <a href="javascript:;" class="palyercon_right_tool_add js_addto">
						<i class="iconfont icon-tianjia"></i> <span>添加到</span>
					</a> <a href="javascript:;" class="js_collect"> <i
						class="iconfont icon-shoucang"></i> <span>收藏</span>
					</a> <a href="javascript:;" id ="logindelete" class="js_delete" style ="display: none"> <i
						class="iconfont icon-lajitong"></i> <span>删除</span>
					</a>
					<div class="search_music">
						<input type="text" class="js_searchInput" placeholder="搜索音乐">
						<i class="iconfont icon-fangdajing search_icon js_searchsongs"></i>
					</div>
				</div>
				<!-- 添加 -->
				<div class="add_songer js_addtools" style="display: none;">
					<ul>
						<li><a href="javascript:;" class="js_mylover">我喜欢</a></li>
						<li><a href="javascript:;" class="js_collect">收藏</a></li>
						<div class="spacile_aa">添加到歌单</div>
						<ul class="js_topaddsongsheet">
							<li class="js_addsheet"><a href="javascript:;">暂无自定义歌单</a></li>
						</ul>
					</ul>
				</div>
				<!-- 详细 -->
				<!-- 播放列表 -->
				<ul class="songlist_header js_songheader">
					<li
						class="js_Songcheck song_list_li songlist_header_list songlist_header_check"><input
						type="checkbox" id="allOptionId" value="all" /></li>
					<li class="songlist_header_list " style="width: 13px"></li>
					<li class="songlist_header_list songlist_header_song">歌曲</li>
					<li class="songlist_header_list songlist_header_person">歌手</li>
					<li class="songlist_header_list songlist_header_time">时长</li>
				</ul>
				<div class="palyercon_right_list" id="songlist">
					<ul class="songlist_header js_songlistheader " id="js_idsonglist">
					</ul>
					<!-- loading图片 -->
					<div class="loading_img">
						<img src="img/loading.gif" alt="">
					</div>
				</div>
			</div>
		</div>
		<!-- footer -->
		<div class="music_footer" id="footerpage">
			<div class="music_fo_content">
				<div class=" list_music_img " id="imgshow">
					<img class="f_l js_foodimgshow"
						src="music/imge/show"
						alt="歌曲图片" height="65" width="65"> <a href="javascript:;"
						class="f_l tuzi"><i class="iconfont icon-xinzhankai"></i></a>
				</div>
				<a href="javascript:;" class="music_leftsong tuzi"><i
					class="iconfont icon-youbofang-copy-copy"></i></a> <a
					href="javascript:;" class="tuzi js_footestop" style="top: 18px;"
					data-index="1" data-id=""><i class="iconfont icon-xinzanting1"></i></a>
				<a href="javascript:;" class="tuzi "><i
					class="iconfont icon-youbofang"></i></a>
				<div class="list_footer_top music_info">
					<!-- 播放时间 -->
					<div class="music_time">
						<div class="music_time_left">
							<span class="js_songname"></span>- <span class="js_songsonger">（づ￣3￣）づ╭❤～</span>
						</div>
						<div class="music_time_right">
							<span class="timeend">00:00</span>/<span class="timestar">00:00</span>
						</div>
					</div>
					<!-- 底部进度条 -->
					<!-- <div class="progress"><div class="progress_bar"></div><span class="progress_toll"></span></div>  -->
					<div class="lanren" id="lanrenpro">
						<div class="process js_foplayprecess" id="playPrecess_footer">
							<a href="javascript:;" draggable="false" class="bg_value js_pre"
								id="playPre_footer"></a> <a href="javascript:;"
								draggable="false" class="bg_bar"></a> <a href="javascript:;"
								draggable="false" class="process_circle js_prevalue"
								id="playPrevalue_footer"> <span id="circlebox"></span>
							</a>
						</div>
					</div>
				</div>
				<div class="music_info">
					<div class="music_info">
						<a href="javascript:;" class="xuanze js_changeMode"><i
							class="iconfont icon-shunxubofang" title="顺序播放"></i></a>
					</div>
					<div class="music_info">
						<a href="javascript:;" class="tuzi js_loverfoot"><i
							class="iconfont icon-aixinkong1"></i></a>
					</div>
					<a href="javascript:;" class="tuzi js_download"><i
						class="iconfont icon-xinxiazai"></i></a>
					<!-- <a href="javascript:;" class="zhunxin tuzi  js_zhunxin" ><i class="iconfont icon-zhunxintouming"></i></a>   -->
					<div class="music_info sound">
						<a href="javascript:;" class="tuzi js_metd"><i
							class="iconfont icon-xinyinliang"></i></a>
						<div class="lanren1">
							<!-- 底部音量进度条 -->
							<div class="process1  js_fosoundprecess" id="soundPrecess_footer">
								<a href="javascript:;" draggable="false"
									class="bg_value1 js_fosoundpre" id="soundPre_footer"></a> <a
									href="javascript:;" draggable="false" class="bg_bar1"></a> <a
									href="javascript:;" draggable="false"
									class="process_circle1  js_fosoundprevalue"
									id="soundPrevalue_footer"> <span id="soundcicrl_footer"></span>
								</a>
							</div>
						</div>
					</div>
					<div class="music_info footer_right" id="playerlan">
						<a href="javascript:;" class="tuzi" title="播放列栏"><i
							class="iconfont icon-xinbofangliebiao"></i><span
							class="music_num js_songtotle"></span></a>
					</div>
				</div>
			</div>
		</div>
		<!--弹框  -->
		<div class="erro_frame" style="display: none">
			<i class="iconfont icon-danchujinggao erro_frame_commond"></i>
			<div class="erro_frame_commond">请选择操作的单曲</div>
		</div>
		<!-- 播放列栏  -->
		<div class="player " id="player" style="display: none;">
			<h2>播放列表</h2>
			<div class="player_tool">
				<div class="player_tool_num music_info">
					<span class="js_songtotle">0</span>首歌曲
				</div>
			</div>
			<div class="js_testscroll testscroll">
				<ul class="player_list js_bofanglist js_songlistheader js_songlistheadersmall"></ul>
			</div>
		</div>
	</div>
	<!-- 弹框处理 -->
	<div class="bombpromt js_bombpromt" style="display: none">
		<img src="img/bombpromt.gif" alt="" height="100"
			style="padding-left: 43px">
		<p class="js_bombword">操作成功</p>
	</div>
	<!--提示框页面-->
	<div class="commingpage js_deleteconfirm" style="display:none;" >
		<div class="confirm" >
			<div class="landing_title"><i class="iconfont icon-guanbi" onclick="closeDelete()"></i></div>
			<p class="landing_title_tt js_confirmVlue">确定删除该表吗？</p>
			<input type="button" value="取消" class="isok deleteno" onclick="closeDelete()">
			<input type="button" value="确定" class="isok isno deleteok" onclick="deleteCustomList()">
		</div>
	</div>
	<!--切换用户确认页面-->
	<div class="commingpage js_changeconfirm" style="display: none;" >
		<div class="confirm" >
			<div class="landing_title"><i class="iconfont icon-guanbi" onclick="closeChange()"></i></div>
			<p class="landing_title_tt js_confirmVlue">确定切换登陆用户吗？</p>
			<input type="button" value="取消" class="isok changeno" onclick="closeChange()">
			<input type="button" value="确定" class="isok isno changeok"  >
		</div>
	</div>
	<!--用户注销确认页面-->
	<div class="commingpage js_banconfirm" style="display: none;" >
		<div class="confirm" >
			<div class="landing_title"><i class="iconfont icon-guanbi" onclick="closeBan()"></i></div>
			<p class="landing_title_tt js_confirmVlue">确定注销当前用户吗？</p>
			<input type="button" value="取消" class="isok banno" onclick="closeBan()">
			<input type="button" value="确定" class="isok isno banok"  >
		</div>
	</div>
	<!-- 登录成功提示 -->
	<div id="js_loginframe" class="login_frame js_loginframe"
		style="display: none">
		<div class="erro_frame_commond js_loginname">登录成功</div>
	</div>
	<!-- 歌词界面 -->
	<div class="bobo" id="gecipage"></div>
	<!-- 登陆页面 -->
	<div class="commingpage" style="display: none" id="landingPage"></div>
	<!-- 上传界面  -->
	<div class="commingpage" id="uploadpage" style="display: none"></div>
    <!--个人信息界面-->
    <div class="commingpage" id="personalinfo" style="display: none"></div>
	<!--修改密码界面-->
	<div class="commingpage" id="changepassword" style="display: none"></div>
	<!-- 背景模糊 -->
	<div class="bg-img-mask"></div>
	<div class="bg-img"></div>
	<script type="text/javascript" src="js/scroll.js"></script>
	<script type="text/javascript" src="js/player.js"></script>
	<script>
		//控制切换背景图片方法的次数（因为是使用时间滚动的来判断音乐自动完成时进行图片切换，判断方法一直执行，有时同时间会多次调用，使用imgChangeCheck控制当被多次调用时只执行一次）
		var imgChangeCheck = 0;
		//本地img背景素材数组
		var localimgs = ["CMF.jpg","moren.jpg","g.jpg","4389156_1427265276098_800x600.jpg",
			"ecada312c8fcc3ceca670edd9945d688d63f20f2.jpg","gamersky_14origin_27_20165231652E50.jpg",
			"mingrixiang2.jpg","mingrixiang4.jpg","mingrixiang5.jpg", "timg (4).jpg","738da9773912b31b428fe0d88618367adbb4e164.jpg"];
		//包含各种关闭弹窗方法
		//删除自定义歌单功能
		var $this = this;
		function tip(text){
			var bomb = $(".js_bombword").html(text);
			$(".js_bombpromt").fadeIn().stop(true,true);
			setTimeout(function(e){
				$(".js_bombpromt").fadeOut();
			},2000);
		}
		function closeDelete(){
            $(".js_deleteconfirm").attr("style","display:none;");
        }
		function deleteCustomList(){
			var customlistid = $(".deleteok").attr("id");
			    $.ajax({
			        url : "music/customlist/deletecustomlist",
			        data : {lid:customlistid},
			        dataType : "json",
			        type : "post",
			        success : function(data) {
			            var result = data.result;
			            if(result == "success"){
							$(".js_deleteconfirm").attr("style","display:none;");
							$this.tip("删除成功(*/ω＼*)");
							$(".js_playall").click();
							findSongLists();
						}else{
							$this.tip("删除失败(；´д｀)");
							$(".js_playall").click();
						}
			        },
			        error : function(data) {
						$this.tip("删除失败(；´д｀)");
						$(".js_playall").click();
			        }
			    });
		}
		//关闭切换用户确认窗口
        function closeChange(){
            $(".js_changeconfirm").attr("style","display:none;");
        }
		function closeBan(){
			$(".js_banconfirm").attr("style","display:none;");
		}
	</script>
	<script>
        //load()方法页面加载
        $("#gecipage").load("pages/lyricpage.html");
        $("#landingPage").load("pages/loginpage.html");
        $("#uploadpage").load("pages/uploadpage.html");
        $("#changepassword").load("pages/changepasswordpage.html");
        $("#personalinfo").load("pages/personinfopage.html");

        // 列表加载
        $(document).ready(function(){
            let timeMark=true;
            //播放
            let play ={
                arrsong: [],
                init(){
                    //播放停止切换

                    this.muted();
                    this.lover();
                    this.showListContent();
                    //双击播放
                    this.showTollslist();
                    //歌曲的删除
                    this.deleteCheck();
                    //添加到
                    this.addSonger();
                    //收藏
                    this.collect();
                  	//下载歌曲
                    this.download();
                    //添加到歌单
                    this.addSongsheet();
                    $(".js_value").attr('title',$(".js_value").text());
                },
                //显示三个工具栏
                showListContent(){
                    //1.LI鼠标onmousenter事件
                        $(".js_songlistheader").on("mouseenter",".js_songli",function(){
                            $(this).find(".js_listcontent").addClass("hover")
                            if($(this).find(".js_listcontent").hasClass("hover")){
                                $(this).find(".js_songtools").css("display","inline-block");
                            }
                        }).on("mouseleave",".js_songli",function(){
                            $(this).find(".js_listcontent").removeClass("hover");
                            if($(this).find(".js_listcontent").hasClass("active") == false){
                                $(this).find(".js_songtools").css("display","none");
                            }
                        });
                    //2.Li鼠标点击选中事件  选中列表 移除鼠标事件
                        $(".js_songlistheader").on("click",".js_songli",function(e){
                            $(".js_lrctime").show();
                            $(".js_songli").find(".js_listcontent").removeClass("active");
                            if($(".js_songli").find(".js_listcontent").hasClass("active") == false){
                                $(".js_songli").find(".js_songtools").css("display","none");
                            }
                            $(this).find(".js_listcontent").addClass("active")
                            // var $this = this;
                            if($(this).find(".js_listcontent").hasClass("active")){
                                $(this).find(".js_songtools").css("display","inline-block");
                                $(this).find(".js_lrctime").hide();
                            }

                        });
                    //4.点击当前的操作下拉的功能实现  传递当前的歌曲id 在模板哪里添加data-id  通过$(this).data(id)
                },
                //显示工具栏中详细的列表
                showTollslist(){
                    var $this = this;
                    //3.小圈圈点击事件 显示操作下拉
                        $("html,body").on("click",function(e){
                            if(!($(e.target).closest(".js_xiangxi").length>0 || $(e.target).closest(".js_xiangxixi").length>0)){
                                $(".js_xiangxixi").hide();
                                $(".js_songlistheader").on("mouseenter",".js_songli",function(){
                                    $(this).find(".song_list_content").addClass("hover")
                                    if($(this).find(".song_list_content").hasClass("hover")){
                                        $(this).find(".song_list_content .songlist_header_song .js_songtools").css("display","inline-block");
                                    }
                                })
                            }
                        })
                        $(".js_songlistheader").on("click",".js_xiangxi",function(e){
                        	 if(e.pageY>document.getElementById("songlist").clientHeight){
                                 $(this).find(".js_xiangxixi").css({
                                     "top": e.pageY*0.6,
                                     "left": e.pageX
                                 }).toggle();
                             }else{
                                 $(this).find(".js_xiangxixi").css({
                                     "top": e.pageY,
                                     "left": e.pageX
                                 }).toggle();
                             }
                            $(".js_songlistheader").unbind("mouseenter");

                        })
                        $(".js_songlistheader").on("click",".js_xiangxixi",function(e){
                            e.stopPropagation();
                        })
                    //添加到我喜欢
					  $(".js_songlistheader").on("click",".js_mylover",function(e){
						  if(isLogin == true){
						  	//模拟点击爱心
							  var aixin = $(this).parent().parent().parent().prev().prev(); //获取小爱心标签
							  aixin.trigger("click");
						  }else{
							  $this.tip("小伙伴忘记登录啦(*/ω＼*)")
						  }
                        })
                    //添加到收藏
                        $(".js_songlistheader").on("click",".js_mycollect",function(e){
                        	//单曲添加到收藏
                        	if(isLogin == true){
								var mid = $(this).parent().parent().data("id");
                        		$.ajax({
                        			url : "music/addtosonglist/addtocollect",
                        			data : {mid:mid},
                        			dataType : "json",
                        			type : "post",
                        			success : function(data) {
                        				if(data.Tip==true){
                        					$this.tip("收藏好了o(*////▽////*)q");
                                            $(".js_xiangxixi").hide();
                        				}else{
                        					$this.tip("收藏失败o(*////▽////*)q")
                        				}

                        			},
                        			error : function(data) {
                        				$this.tip("收藏失败o(*////▽////*)q")
                        			}
                        		});
                        	}else{
                        		$this.tip("小伙伴忘记登录啦(*/ω＼*)")
                        	}
                        })
                    //添加到歌单
                        $(".js_songlistheader").on("click",".js_gedan",function(e){

                        	if(isLogin==true){
                        		//var $this = this;
                            	//单曲添加到歌单
                            	var songListName = $(this).html();
								var mid = $(this).parent().parent().parent().data("id");
                            	$.ajax({
                        			url : "music/addtosonglist/addtosheet",
                        			data : {songListName:songListName,mid:mid},
                        			dataType : "json",
                        			type : "post",
                        			success : function(data) {
                        				if(data.Tip==true){
                        					$this.tip("添加好了o(*////▽////*)q");
                                            $(".js_xiangxixi").hide();
                        				}else{
                        					$this.tip("收藏失败o(*////▽////*)q")
                        				}
                        			},
                        			error : function(data) {
                        				$this.tip("添加失败o(*////▽////*)q")
                        			}
                        		});
                        	}else{
                        		$this.tip("小伙伴忘记登录啦(*/ω＼*)")
                        	}
                        })
                },
            //功能条
                //添加到
                addSonger(){
                    var $this = this;
                    $("html,body").on("click",function(e){
                        if(!($(e.target).closest(".js_addto").length>0 || $(e.target).closest(".js_addtools").length>0)){
                            $(".js_addtools").hide();
                    }
                    })
                    //添加到 显示列表
                    $(".js_addto").click(function(e){
                        $("#xiangxixi").hide();
                        $(".js_addtools").toggle();
                    })
                    //添加到我喜欢
                    $(".js_mylover").click(function(){
                    	//样式
                    	$(".js_addtools").css("display","none");
                    	if(isLogin == true){
                    		if($("#js_idsonglist input:checkbox:checked")){
                                if($("#js_idsonglist input:checkbox:checked").length == 0){
                                    $this.tip("请选择歌曲操作啦(≧∇≦)ﾉ")
                                }else{
                                  //多曲添加到我喜欢列表
                                  addLikes($this);
                                }
                            }
                    	}else{
                    		$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ")
                    	}
                    })
                    //添加到歌单

                },
                //删除 (包括删除歌曲自定义列表功能)
                deleteCheck(){
                    var $this = this;
                    //删除功能，多曲从个人列表中删除
                    $(".js_delete").on("click",function(){
                        if($("#js_idsonglist input:checkbox:checked")){
                        	if(isLogin==true){
                        		if($("#js_idsonglist input:checkbox:checked").length == 0){
                                    $this.tip("请选择歌曲操作啦(≧∇≦)ﾉ")
                                }else{
    							    if($(".palyercon_left li").hasClass("focus")){
    						    		var chks = document.querySelectorAll('#songlist input[type="checkbox"]');
    								    var listSelected = [];
    								    var songListName = $(".focus").text();
    								    for (var i = 0; i < chks.length; i++) {
    								        var chk = chks[i];
    								        if(chk.checked){
    								        	listSelected.push(chk.closest("li").getAttribute("data-songid"));
    								        }
    								    }
    								    $.ajax({
    										url : "music/addtosonglist/outtosheets",
    										data : {
    													"songListName":songListName,
    													"listSelected":JSON.stringify(listSelected)
    												},
    										dataType : "json",
    										type : "post",
    										traditional:true,
    										contentType:"application/x-www-form-urlencoded; charset=utf-8",
    										async : false,
    										success : function(data) {
    											if(data.outJudge == false){
    												$this.tip(data.outTip);
                                                }else if(data.Tip==true){
													$(".focus").trigger("click");
    												$this.tip("删除成功♪(^∇^*)");
    											}else{
    												$this.tip("删除失败╮(╯▽╰)╭");
    											}
    										},
    										error : function(data) {
    										}
    									});
    		                        }else{
    	                            	$this.tip("你还未选中歌单列表哦♪(^∇^*)");
    	                            }
                                }
                        	}else{
                        		$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ")
                        	}
                        }
                    })

                },
                //收藏 //添加LI上面的收藏功能    在模板哪里添加data-id  通过$(this).data(id)
                collect(){
                    var $this = this;
                    $(".js_collect").on("click",function(){
                    	$(".js_addtools").css("display","none");
                    	if(isLogin == true){
                    		if($("#js_idsonglist input:checkbox:checked")){
                                if($("#js_idsonglist input:checkbox:checked").length == 0){
                                    $this.tip("请选择歌曲操作啦(≧∇≦)ﾉ")
                                }else{
                                    //多曲收藏
                                    addCollects($this)
                                }
                            }
                    	}else{
                    		$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ")
                    	}
                    })
                },
                //添加到歌单
                addSongsheet(){
                    var $this = this;

                    $(".js_topaddsongsheet").on("click",".js_addsheet",function(){
                    	$(".js_addtools").css("display","none");
                    	if(isLogin==true){
                    		if($("#js_idsonglist input:checkbox:checked")){
                                // $("#js_idsonglist input:checkbox:checked").closest('li').remove()
                                if($("#js_idsonglist input:checkbox:checked").length == 0){
                                    $this.tip("请选择歌曲操作啦(≧∇≦)ﾉ")
                                }else{
                                	//多曲添加到个人的自定义歌单
                                	var chks = document.querySelectorAll('#songlist input[type="checkbox"]');
    							    var listSelected = [];
    							    for (var i = 0; i < chks.length; i++) {
    							        var chk = chks[i];
    							        if(chk.checked){
    							        	listSelected.push(chk.closest("li").getAttribute("data-songid"));
    							        }
    							    }
    							    var songListName = $(this).children("a").html();
    								$.ajax({
    									url : "music/addtosonglist/addtosheets",
    									data : {
    												"songListName":songListName,
    												"listSelected":JSON.stringify(listSelected)
    											},
    									dataType : "json",
    									type : "post",
    									traditional:true,
    									contentType:"application/x-www-form-urlencoded; charset=utf-8",
    									async : false,
    									success : function(data) {
    										if(data.Tip==true){
                                                $(".icheckbox_square-pink").removeClass("checked");
    											$this.tip("添加成功啦♪(^∇^*)");
    										}else if(data.Tip==false){
    											$this.tip("添加失败╮(╯▽╰)╭");
    										}
    									},
    									error : function(data) {
    									}
    								});
                                }
                            }
                    	}else{
                    		$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ")
                    	}
                    })
                },
                //下载歌曲文件到本地
                download(){
                    var $this = this;
                    $(".js_download").on("click",function(){
                    	var indexNum = $(".js_footestop").data("index");
                    	var src = playerMusic.arrSongs[indexNum];
                    	//不能使用页面跳转，得新开窗口
                        var url = "music/download/downloadsong?src="+src;
                     	window.open(url);
                     })
                },
                //提示框
                tip(text){
                    var bomb = $(".js_bombword").html(text);
                    $(".js_bombpromt").fadeIn().stop(true,true);
                    setTimeout(function(e){
                        $(".js_bombpromt").fadeOut();
                    },2000);
                },
                //静音切换
                muted(){
                    $(".js_metd").click(function(){
                        if($(this).find('i').hasClass("icon-xinyinliang")){
                            $(this).find('i').removeClass("icon-xinyinliang").addClass("icon-yinliang");
                            playerMusic.stopVolome();
                        } else {
                            $(this).find('i').removeClass("icon-yinliang").addClass("icon-xinyinliang");
                            playerMusic.stopVolome();
                        }
                    })
                },
                //喜欢
                lover(){
                    var $this = this;
                    $(".js_songlistheader").on("click",".js_lover",function(e){
                    	if(isLogin == true){
                    		var index = $(this).closest("li").data("index");
                    		var mid = $(this).closest("li").data("songid");
                            if($(this).find('i').hasClass("icon-aixinkong1")){
                            	$(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find('.js_lover i').removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)");
                                $(this).find('i').removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)");
                                if($(this).parent().parent().find(".js_stop i").hasClass("icon-xinzanting")){
                                    $(".js_loverfoot").find("i").removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)");
                                    $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_lover i").removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)");
                                }
                                //列表中的小爱心功能，类似收藏到我喜欢列表
                                $.ajax({
                            		url : "music/addtosonglist/addtolike",
                            		data : {mid:mid},
                            		dataType : "json",
                            		type : "post",
                            		success : function(data) {
                            			if(data.Tip==true){
                            				$this.tip("成功添加到mylove(￣▽￣)~*");
										}else if(data.Tip==false){
											$this.tip("添加失败╮(╯▽╰)╭");
										}
                            		},
                            		error : function(data) {
                            		}
                            	});
                            }else{
                                $(this).find('i').removeClass("icon-aixin1").addClass("icon-aixinkong1 ").css("color","#c3c3c3");
                                $(".js_loverfoot").find("i").removeClass("icon-aixin1").addClass("icon-aixinkong1").css("color","#c3c3c3")
                                $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_lover i").removeClass("icon-aixin1").addClass("icon-aixinkong1").css("color","#c3c3c3")
                            	//列表小爱心取消收藏
                                $.ajax({
                            		url : "music/addtosonglist/outtolike",
                            		data : {mid:mid},
                            		dataType : "json",
                            		type : "post",
                            		success : function(data) {
                            			if(data.Tip==true){
                            				$this.tip("谢谢你曾经喜欢我┭┮﹏┭┮");
										}else if(data.Tip==false){
											$this.tip("取消收藏失败╮(╯▽╰)╭");
										}
                            		},
                            		error : function(data) {
                            		}
                            	});
                            }

                    	}else{
                    		$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ")
                    	}
                    })
                    $(".js_lover").find('i').hasClass("icon-aixinkong1");
                    $(".js_loverfoot").on("click",function(){

                       if(isLogin == true){
                    	   var index = $(".js_footestop").data("index");
                    	   var mid = $(".js_footestop").data("id");
                           if($(this).find('i').hasClass("icon-aixinkong1")){
                                $(".js_loverfoot").find("i").removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)")
                                $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_lover i").removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)")
                                //收藏当前播放歌曲（播放条小爱心）
                                $.ajax({
                            		url : "music/addtosonglist/addtolike",
                            		data : {mid:mid},
                            		dataType : "json",
                            		type : "post",
                            		success : function(data) {
                            			if(data.Tip==true){
                            				$this.tip("成功添加到mylove(￣▽￣)~*");
										}else if(data.Tip==false){
											$this.tip("取消收藏失败╮(╯▽╰)╭");
										}
                            		},
                            		error : function(data) {
                            		}
                            	});
                            }else{
                                $(".js_loverfoot").find("i").removeClass("icon-aixinkong1").addClass("icon-aixinkong1 ").css("color","#c3c3c3");
                                $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_lover i").removeClass("icon-aixin1").addClass("icon-aixinkong1").css("color","#c3c3c3")
                                //取消收藏（播放条小爱心）
                                $.ajax({
                            		url : "music/addtosonglist/outtolike",
                            		data : {mid:mid},
                            		dataType : "json",
                            		type : "post",
                            		success : function(data) {
                            			if(data.Tip==true){
                            				$this.tip("谢谢你曾经喜欢我┭┮﹏┭┮");
										}else if(data.Tip==false){
											$this.tip("取消收藏失败╮(╯▽╰)╭");
										}
                            		},
                            		error : function(data) {
                            		}
                            	});
                            }
                       }else{
                   		$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ")
                   	   }
                    })
                },
            }
            play.init();
            //个人详细
			let personal = {
				init(){
					this.personinfo();

					this.personxiangxi();

					this.banuser();
				},
				//个人信息表单
				personinfo(){
					var $this = this;
					$("html,body").on("click",function(e){
						if(!($(e.target).closest(".js_username").length>0 || $(e.target).closest(".js_userinfo").length>0)){
							$(".js_userinfo").hide();
						}
					})
					//个人详细 显示列表
					$(".js_username").click(function(e){
						$("#personinfo").hide();
						$(".js_userinfo").toggle();
					})
				},
				//个人详细内功能
				personxiangxi(){
					//退出登录
					$(".js_ploginout").click(function(e){
						signOut();
					});
					//切换账号
					$(".js_changeuser").click(function(e){
                        $(".js_changeconfirm").css("display","");
					});
                    $(".changeok").click(function(e){
                        $(".js_changeconfirm").css("display","none");
                        $("#personinfo").hide();
                        $(".js_landing").hide();
                        isLogin=false;
                        userNameCurrent=null;
                        userIdCurrent=null;
                        $("#landingUser").css("display","");
                        setTimeout(function(e){
                        	//loginpage.html中重置验证状态
                        	$("#landingPage").show();
                        },500);
                    })
					//个人信息
					$(".js_pinfo").click(function(e){
						$("#personinfo").hide();
						$("#personalinfo").css("display","inline");
					});
					//用户注销确认弹窗
					$(".js_banuser").click(function (e) {
						$("#personinfo").hide();
						$(".js_banconfirm").css("display","inline");
					})
					$(".js_changeuserpassword").click(function(e){
						$(".js_userinfo").hide();
						$("#changepassword").toggle();
					})
				},
				//用户注销
				banuser(){
					$(".banok").click(function (e) {
						$.ajax({
							url : "music/user/banuser",
							data : {},
							dataType : "json",
							type : "post",
							success : function(data) {
								var result = data.result;
								if(result == 1){
									$(".js_banconfirm").css("display","none");
									$(".js_landing").hide();
									$("#landingUser").css("display","");
									//loginpage.html中重置验证状态
									$this.tip("用户注销成功");
									setTimeout(function(e){
										signOut();
									},1000);

								}else{
									$this.tip("用户注销失败╮(╯▽╰)╭");
								}
							},
							error : function(data) {
							}
						});
					})
				}
			};
			personal.init();
            //底部功能
            let footerPlay = {
                init(){
                    playerMusic.playIndex(function(){
                        $(".js_footestop").data("index",this.num);
                    });

                    this.changeMode();
                },

                //歌曲模式切换
                changeMode(){
                    $(".js_changeMode").click(function(){
                        if($(".js_changeMode").find("i").hasClass("icon-shunxubofang")){
                            //单曲循环
                            $(".js_changeMode").find("i").removeClass("icon-shunxubofang").addClass("icon-danquxunhuan");
                            $(".js_changeMode").find("i").attr("title","单曲循环");
                            playerMusic.playModel="singleLoop"
                        }else if($(".js_changeMode").find("i").hasClass("icon-danquxunhuan")){
                            //随机播放
                            $(".js_changeMode").find("i").removeClass("icon-danquxunhuan").addClass("icon-suijibofang");
                            $(".js_changeMode").find("i").attr("title","随机播放");
                            playerMusic.playModel="randomLoop"
                        }else if($(".js_changeMode").find("i").hasClass("icon-suijibofang")){
                            //循环列表
                            $(".js_changeMode").find("i").removeClass("icon-suijibofang").addClass("icon-liebiaoxunhuan");
                            $(".js_changeMode").find("i").attr("title","循环播放");
                            playerMusic.playModel="listLoop"
                        }else {
                            //顺序播放
                            playerMusic.playModel="shunxunLoop"
                            $(".js_changeMode").find("i").removeClass("icon-liebiaoxunhuan").addClass("icon-shunxubofang");
                            $(".js_changeMode").find("i").attr("title","顺序播放");
                        }
                    })
                },
                //时间
            };
            footerPlay.init()
            //左侧列表栏
            let leftList = {
                init(){
                    //创建新的歌单
                    this.addSonesheet();
                    //左侧列表样式
                    this.leftlist();
                    //编辑
                    this.editLeftlist();
                    //显示
                    this.show();
                },
                reset(){
                    $('.js_songli').find(".js_stop i").removeClass("icon-xinzanting").addClass("icon-xinzanting1");
                },
				tip(text){
					var bomb = $(".js_bombword").html(text);
					$(".js_bombpromt").fadeIn().stop(true,true);
					setTimeout(function(e){
						$(".js_bombpromt").fadeOut();
					},2000);
				},
                //创建新的歌单
                addSonesheet(){
						var $this = this;
                        var mark = true;
                        var markHtml = false;
                        $("html,body").on("click",function(e){
                            if(!($(e.target).closest(".left_li.focus").length>0 || $(e.target).closest(".js_songsheet").length>0)){

                            	if(markHtml){
                            		var html1 = `
                                        <a href="javascript:;" class="js_testhtml testa"  draggable="false">
                                        <input id="customlist_id" type="hidden" >
                                        <i class="iconfont icon-yinle"  style="top:-1px;"></i><span class="js_value lestli_val"></span></a>
                                        <div class="js_box leftli_box" style="display:none">
                                            <span class="js_leftlidelte"><i class="iconfont icon-lajitong"></i></span>
                                            <span class="js_leftedit"><i class="iconfont icon-qianbi"></i></span>
                                        </div>
                                    `
	                                // var val = $(".js_songlist li:last").find("input").val();
	                                // $(".js_songlist li:last").find(".js_input").replaceWith(html1);
	                                // $(".js_songlist li:last").find(".js_value").html(val);
									// 若是如此，创建新自定义歌单后，点击页面会把自定歌单显示编程歌单id
									var val = $(".js_newlistname").val();
									listname = val;
									if(listname != ""){
										mark = true;
										//页面添加新歌单瞬间，调用ajax添加自定义歌单
										$.ajax({
											url : "music/customlist/addcustomlist",
											data : {listname:listname},
											dataType : "json",
											type : "post",
											success : function(data) {
												var result = data.result;
												if(result == "success"){
													$(".js_songlist li:last").find(".js_input").replaceWith(html1);
													$(".js_songlist li:last").find(".js_value").html(val);
													$(".js_songlist li:last").find("#customlist_id").attr("value",data.lid);
													$this.tip("创建歌单成功(≧∇≦)ﾉ");
													$(".js_playall").click();
													findSongLists();
												}else if(result == "false"){
													$(".js_songlist li:last").find(".js_input").remove();
													$this.tip("创建歌单失败，已有同名歌单");
													$(".js_playall").click();
												}else{
													$(".js_songlist li:last").find(".js_input").remove();
													$this.tip("创建歌单失败(；д；)");
													$(".js_playall").click();
												}
											},
											error : function(data) {
												$this.tip("创建歌单失败(；д；)");
											}
										});
									}else{
										$(".js_songlist li:last").find(".js_input").remove();
										$this.tip("歌单名不能为空哟(╯>д<)╯");
										$(".js_playall").click();
									}

	                                markHtml = false;
	                                mark = true;
                            	}

                            }
                        })
                        $(".js_songsheet").click(function(){
							if ( isLogin == true) {
								var listname;
								if(mark){
									markHtml = true;
									var html = `
                                <li class="left_li focus">
                                    <input type="text" class="js_input js_newlistname " autofocus/>
                                </li>
                                `
									var ulDoms = document.getElementsByClassName("js_songlist");
									var a = $(".js_songlist").append(html);
									mark = false;
									document.onkeydown = function(e){
										var html1 = `
                                        <a href="javascript:;" class="js_testhtml"  draggable="false">
                                        <input id="customlist_id" type="hidden" >
                                        <i class="iconfont icon-yinle"  style="top:-1px;"></i><span class="js_value lestli_val"></span></a>
                                        <div class="js_box leftli_box" style="display:none">
                                            <span class="js_leftlidelte"><i class="iconfont icon-lajitong"></i></span>
                                            <span class="js_leftedit"><i class="iconfont icon-qianbi"></i></span>
                                        </div>
                                    `

										if(e.keyCode == 13) {
											// var val = $(".js_songlist li:last").find("input").val();
											var val = $(".js_newlistname").val();
											listname = val.trim();
											if(listname != ""){
												mark = true;
												//页面添加新歌单瞬间，调用ajax添加自定义歌单
												$.ajax({
													url : "music/customlist/addcustomlist",
													data : {listname:listname},
													dataType : "json",
													type : "post",
													success : function(data) {
														var result = data.result;
														if(result == "success"){
															$(".js_songlist li:last").find(".js_input").replaceWith(html1);
															$(".js_songlist li:last").find(".js_value").html(val);
															$(".js_songlist li:last").find("#customlist_id").attr("value",data.lid);
															$this.tip("创建歌单成功(≧∇≦)ﾉ");
															$(".js_playall").click();
															findSongLists();
														}else if(result == "false"){
															$(".js_songlist li:last").find(".js_input").remove();
															$this.tip("创建歌单失败，已有同名歌单");
															$(".js_playall").click();
														}else{
															$(".js_songlist li:last").find(".js_input").remove();
															$this.tip("创建歌单失败(；д；)");
															$(".js_playall").click();
														}
													},
													error : function(data) {
														$this.tip("创建歌单失败(；д；)");
													}
												});
											}else{
												$(".js_songlist li:last").find(".js_input").remove();
												$this.tip("歌单名不能为空哟(╯>д<)╯");
												$(".js_playall").click();
											}
										}
									}
								}
							}else {
								$(".left_li").removeClass("focus");
								$(".js_playall").addClass("focus");
								$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ");
							}
                        })
                    },
                //左侧列表
                leftlist(){
                    $(".jsall_list").on("click",".left_li",function(){
                        if($(".left_li").hasClass("focus")){
                            $(".left_li").removeClass("focus")
                        }
                        $(this).addClass("focus")
                    })
                    $(".jsall_list").on("click",".left_li",function(e){
                        e.stopPropagation();
                    })
                    //点击自定义歌单查找自定义歌单的歌曲
                    $(".js_songlist").on("click",".left_li",function(){
                        if($(".left_li").hasClass("focus")){
                        	// alert($(this).find("#customlist_id").attr("value"));//获取到点击的自定义歌单的id
                            $(".left_li").removeClass("focus");
                        }
                        $(this).addClass("focus")
                    })
                    $(".js_gedan").on("click",".left_li",function(e){
                        e.stopPropagation();
                    });
                },
                //删除编辑列表
                editLeftlist(){
                    //编辑
                    var sothis = this;

                    //左侧小垃圾桶删除自定义歌单
                    $(".js_songlist").on("click",".js_leftlidelte",function(){
						var customlistid = $(this).parent().prev().children().attr("value");
						$(".deleteok").attr("id",customlistid);
						$(".js_deleteconfirm").attr("style","display:inline;");

                    });
                    var markEdit = false;
                    //按网页位置修改自定义歌单
                    $("html,body").on("click",function(e){
						var customlistid = $(".js_songlist .focus").find("input").val();
                        if(!($(e.target).closest(".left_li.focus").length>0 || $(e.target).closest(".js_songsheet").length>0)){
                        	if(markEdit){
                        		var html1 = `<span class="js_value lestli_val"></span>`
                                var val =  $(".js_songlist .focus").find(".js_input").val();
								var newlistname = val.trim();
								if (newlistname != ""){
									$.ajax({
										url : "music/customlist/updatelistname",
										data : {
											lid: customlistid
											,newlistname:newlistname
										},
										dataType : "json",
										type : "post",
										success : function(data) {
											var result = data.result;
											if(result == "success"){
												$(".js_songlist .focus").find(".js_input").replaceWith(html1);
												$(".js_songlist .focus").find(".js_value").html(val);
												play.tip("修改成功(*/ω＼*)");
											}else if(result == "false"){
												$(".js_songlist .focus").find(".js_input").replaceWith(html1);
												$(".js_songlist .focus").find(".js_value").html(val);
												play.tip("已有同名歌单咯~(*/ω＼*)");
											}else{
												$(".js_songlist .focus").find(".js_input").replaceWith(html1);
												$(".js_songlist .focus").find(".js_value").html(val);
												play.tip("已有同名歌单咯~(*/ω＼*)");
											}
										},
										error : function(data) {
											play.tip("修改失败(*/ω＼*)");
										}
									});
								}else{
									$(".js_songlist .focus").find("a").addClass("addstyle");
									play.tip("歌单名称不能为空(*/ω＼*)");
									test = false;
								}
                                markEdit = false;
								if(markEdit == false){
									$(".js_songlist .focus").find("a").removeClass("addstyle");
									// console.log($(this).parent().parent().find("a").hasClass("addstyle"))
								}
                        	}
                        }
                    })
					//左侧小铅笔修改自定义歌单名
                    $(".js_songlist").on("click",".js_leftedit",function(){
                    	markEdit = true;
                    	var $th = this;
                    	if(markEdit){
							$(this).parent().parent().find("a").addClass("addstyle");
						}
						var customlistid = $(this).parent().prev().children().attr("value");
                        $(".js_songlist").unbind("mouseenter");
                        $(this).parent().hide();
                        var val = $(this).parent().parent().find(".js_value").text()
						//将span切换成input输入框
                        var html = `<input type="text" class="js_input" value="${val}" autofocus="autofocus">`
                        $(this).parent().parent().find(".js_value").replaceWith(html);
                        var $this = this;
                        document.onkeydown = function(e){
                            sothis.show();
                            var test = true;
                            var html1 = `<span class="js_value lestli_val"></span>`
                            if(e.keyCode == 13) {
                                $(".js_songlist").bind("mouseenter");
                                var val = $($this).parent().parent().find(".js_input").val();
                                var newlistname = val.trim();
                                if (newlistname != ""){
									$.ajax({
										url : "music/customlist/updatelistname",
										data : {
													lid: customlistid
													,newlistname:newlistname
											   },
										dataType : "json",
										type : "post",
										success : function(data) {
											var result = data.result;
											if(result == "success"){
												$($this).parent().parent().find(".js_input").replaceWith(html1);
												$($this).parent().parent().find(".js_value").html(val);
												play.tip("修改成功(*/ω＼*)");
											}else if(result == "false"){
												$($this).parent().parent().find(".js_input").replaceWith(html1);
												$($this).parent().parent().find(".js_value").html(val);
												play.tip("已有同名歌单咯~(*/ω＼*)");
											}else{
												// console.log($($th).parent().parent().find(".js_value"))
												// $($th).parent().parent().find("a").addClass("addstyle");
												$($this).parent().parent().find(".js_input").replaceWith(html1);
												$($this).parent().parent().find(".js_value").html(val);
											}
										},
										error : function(data) {
											play.tip("修改失败(*/ω＼*)");
										}

									});
								}else{
									$($th).parent().parent().find("a").addClass("addstyle");
									play.tip("歌单名称不能为空(*/ω＼*)");
									test = false;
								}
                                markEdit = false;
                                if(markEdit == false && test){
                                	// console.log($($th).parent().parent().find("a"))
									$($th).parent().parent().find("a").removeClass("addstyle");
								}
                            }
                        }
                    })

                },
                //显示编辑菜单
                show(){
                    //右键点击弹出菜单
                    $(".js_songlist").on("mouseenter",".left_li",function(e){
                        $(this).find(".js_box").show();
                    }).on("mouseleave",".left_li",function(e){
                        $(".js_box").hide();
                    });
                    $(".js_songlist").on("mouseenter",".left_li",function(e){
                            e.stopPropagation();
                    })
                }
            };
			leftList.init();
            //隐藏显示功能
            let showHide = {
                init(){
                    //显示歌词页面
                    this.showLyripage();
                    //显示隐藏登录页面
                    this.showlandingPage();
                    //显示隐藏上传页面
                    this.showshagnchuanPage();
                    //显示播放列表
                    this.showlistSong();
                },
                tip(text){
                    var bomb = $(".js_bombword").html(text);
                    $(".js_bombpromt").fadeIn().stop(true,true);
                    setTimeout(function(e){
                        $(".js_bombpromt").fadeOut();
                    },2000);
                },
            //显示隐藏操作
                //显示歌词页面
                showLyripage(){
                    $("#imgshow").click(function(){
                    // $("#gecipage").css({"top":"0"}).fadeIn("4000");
                    $("#gecipage").css({"display":"block"}).animate({
                        "top":"0",

                    },500)
                    $("#mainplayer").hide()
                    })
                    $("#gecipage").on("click","#logodowon",function(){
                        // $("#gecipage").css({"top":"100px"}).fadeOut("4000");
                        $("#gecipage").animate({
                            "top":"100%",
                        },500).css({"display":"none"});
                        $("#mainplayer").show();
                    });
                },
                //显示隐藏登录页面
                showlandingPage(){
                    $("#landingUser").click(function(){
                        $("#landingPage").show();
                    });
                    $("#landingPage").on("click",".landing_title",function(){
						$("#landingPage").hide();
					})
                },
                //显示隐藏上传页面
                showshagnchuanPage(){
                	var $this = this;
                    $("#shangchuancopyban").click(function(){
                    	if(isLogin == true){
                        $("#uploadpage").show();
                       }else{
				        $this.tip("小伙伴忘记登录啦(*/ω＼*)");
				   	   }
                    });
                    $("#uploadpage").on("click","#upload",function(){
						$("#uploadpage").hide();
					})
                },
                //显示播放列表
                showlistSong(){
                    $("#footerpage").on("click","#playerlan",function(e){
                    	//歌单页面右侧歌单表
                        if($("#player").css("display") == "none") {
                            $("#player").css({"display":"inline-block"}).animate({
                                "right":-80
                            },"fast");
                        } else {
                            $("#player").css({"display":"none"}).fadeOut().css({"right":"-50%"});
                        };
                        e.stopPropagation();
                    });
                    $("#gecipage").on("click",".js_playerlan",function(e){
						//歌词页面右侧歌单表
                        if($(".js_lrcp").css("display") == "none") {
                            $(".js_lrcp").css({"display":"inline-block"}).animate({
                                "right":-80
                            },"fast");
                        } else {
                            $(".js_lrcp").css({"display":"none"}).fadeOut().css({"right":"-50%"});
                        };
                        e.stopPropagation();
                    });

                }
            }
            showHide.init();
            //拖拽
            let drag = {
                init(){
                    //底部播放器
                    var $this = this;
                    var dragpre;
                    var pre = document.getElementById("playPrecess_footer").offsetWidth - 12;
                    var volumeText;
                    var timer = null;
                    //歌词页面
                        //歌词页面进度条拖拽
                        timer = setTimeout(function(){
                            new scrollDom("playPre_lrc","playPrevalue_lrc","js_playlrc").init(function(a){
                                timeMark = false;
                                var timeval = $this.changeTime($(".timestar").html());
                                var x = parseInt(a.x);
                                dragpre = $this.formateTime((timeval*x)/pre);
                                $(".timeend").html($this.formateTime((timeval*x)/pre))
                            },function(a){
                                timeMark = true;
                                $(".js_pre").css("width",a.x);
                                $(".js_prevalue").css("left",a.y);
                                playerMusic.perTest($this.changeTime(dragpre))
                            })

                            //歌词页面音量拖拽
                            new scrollDom("soundPre_lrc","soundPrevalue_lrc","soundPrecess_lrc").init(function(a){
                                $(".js_fosoundpre").css("width",a.x);
                                $(".js_fosoundprevalue").css("left",a.y);
                                var t = Math.floor($(".js_precess_sound").width()-11)
                                volumeText = (parseInt(a.x)/t)
                                playerMusic.soundCountrol(volumeText)
                            },function(a){
                                $(".js_fosoundpre").css("width",a.x);
                                $(".js_fosoundprevalue").css("left",a.y);
                                $(".icon-yinliang").removeClass("icon-yinliang").addClass("icon-xinyinliang");
                                if(volumeText >1){
                                    volumeText =1;
                                }
                                playerMusic.soundCountrol(volumeText);
                            });

                            //播放页面
                            //播放页面进度条拖拽
                            new scrollDom("playPre_footer","playPrevalue_footer","playPrecess_footer").init(function(a){
                                timeMark = false;
                                var timeval = $this.changeTime($(".timestar").html());
                                var x = parseInt(a.x);
                                dragpre = $this.formateTime((timeval*x)/pre);
                                $(".timeend").html($this.formateTime((timeval*x)/pre))
                            },function(a){
                                timeMark = true;
                                $(".js_pre").css("width",a.x);
                                $(".js_prevalue").css("left",a.y);
                                playerMusic.perTest($this.changeTime(dragpre))
                            })
                            //播放页面音量拖拽
                            new scrollDom("soundPre_footer","soundPrevalue_footer","soundPrecess_footer").init(function(a){
                                $(".js_lrcsoundpre").css("width",a.x);
                                $(".js_lrcsoundprevalue").css("left",a.y);
                                var t = Math.floor($(".js_fosoundprecess").width()-11)
                                volumeText = (parseInt(a.x)/t)
                                playerMusic.soundCountrol(volumeText)
                            },function(a){
                                $(".js_lrcsoundpre").css("width",a.x);
                                $(".js_lrcsoundprevalue").css("left",a.y);
                                $(".icon-yinliang").removeClass("icon-yinliang").addClass("icon-xinyinliang");
                                if(volumeText >1){
                                    volumeText =1;
                                }
                                playerMusic.soundCountrol(volumeText);
                            });
                        },300)
                },
                formateTime: function(time) {
                    var m = parseInt(time / 60);
                    var s = parseInt(time % 60);
                    var time = (m<10?("0"+m):m)+":"+(s<10?("0"+s):s);
                    return time;
                },
                changeTime: function(val) {
                    var m = val.split(":");
                    var s = parseInt(m[0] * 60);
                    var mm = parseInt(m[1] * 1);
                    var time = s+mm;
                    return time;
                },
            };
            drag.init();
            //右侧列表栏  对应的ajax
            let ajaxInfo = {
                mark:true,
                songArrTotal:[],
                songLrcContent: [],
                saerchDoms:[],
                songArr :[],
				preIndex:"",
				init(){

                    let $this  =this;
                    this.loadDate();
                    this.showListsong();
                },
                //歌曲加载完成之后执行的方法
                tableinit(arr){
                	//加载方法标识
                	var tag = 0;
                	var $this = this;
                	this.songArr = arr;
                	this.lrcloadDate(arr);
                	//解析歌词
                    this.lrc(arr,0);
                    //加载歌曲信息
                    this.initFootPlayer(0)
                    //歌词高亮
                    this.timeInit();
                    //全选
                    this.checkSong();
                    //上一首 下一首
                    this.prPrev();
                    this.next();
                    //搜索
                    this.togglePlay(arr,tag);
                    //双击播放
                    this.doublePlayer(arr,tag);
                    this.stopPlay();
                    this.searchInfo();

                    playerMusic.playEndBack = function(index){

                        //加载歌曲信息''
                        $this.initFootPlayer(index);
                        //加载歌词
                        $this.lrc(arr,index);
                        $this.changeIcon(index,"play");
                        $(".js_footestop").data("index",index);
                        $this.preIndex = index;
                    }
                },
				//代替tableinit()切换歌单进行列表信息的加载，如果有一些方法也重新加载会发生播放
				songinfoinit(arr){
                	//初始化复选框状态
					$(".icheckbox_square-pink").removeClass("checked");
					//加载方法标识
                	var tag = 1;
					var $this = this;
					this.songArr = arr;
					this.lrcloadDate(arr);
					//解析歌词
					this.lrc(arr,0);
					//全选
					this.checkSong();
					// //上一首 下一首
					// this.prPrev();
					// this.next();
					//搜索
					this.togglePlay(arr,tag);
					// //双击播放
					this.doublePlayer(arr,tag);
					// this.stopPlay();
					// this.searchInfo();

					playerMusic.playEndBack = function(index){
						//加载歌曲信息''
						//alert(arr)
						$this.initFootPlayer(index);
						//加载歌词
						$this.lrc(arr,index);
						$this.changeIcon(index,"play");
						// $(".js_footestop").data("index",index);
						$this.preIndex = index;
					}
				},
                 initFootPlayer(index){
                 	// console.log(this.songArr[index]);
                    $(".js_songname").text(this.songArr[index]?this.songArr[index].name:"");
                    $(".js_songsonger").text(this.songArr[index]?this.songArr[index].autor:"");
                    $(".timestar").text(this.songArr[index]?this.songArr[index].time:"");
                    $(".js_songalbum").text(this.songArr[index]?this.songArr[index].album:"");
                },
                listLoad(songArr1){
                	var arrSrc = [];
				 	var html ="";
					for(var i = 0,len= songArr1.length; i<len;i++){
						html+= `
						<li class="song_list js_songli" data-songid="${songArr1[i].id}" data-index="${i}">
							<div class="song_list_content js_listcontent">
								<div class="songlist_header_list songlist_header_check song_list_li song_cursor"><input type="checkbox" name="test" /></div>
								<div class="songlist_header_list songlist_img"><img src="img/player-list.png" alt="" height="15" style="position: relative;top: 1px;display:none;" class="js_samllimgstop">
								<img src="img/player-list.gif" alt="" height="15" style="position: relative;top: 1px;display:none;" class="js_samllimg"></div>
								<div class="songlist_header_list songlist_header_song song_cursor">
									<span class="listnum js_listnum">${i+1}</span>
									<span class="js_listname">${songArr1[i].name}</span>
									<div class="songer_tools js_songtools">
										<a href="javascript:;" class="js_lover conyop" data-id="${songArr1[i].id}"><i class="iconfont icon-aixinkong1"></i></a>
										<a href="javascript:;" class="tuzi js_stop conyop"><i class="iconfont icon-xinzanting1"></i></a>
										<a href="javascript:;" class="js_xiangxi " >
											<i class="iconfont icon-gongneng" style="font-size: 20px;"></i>
											 <div class="xiangxi js_xiangxixi" data-id="${songArr1[i].id}">
												<ul>
													<li class="js_mylover">我喜欢</li>
													<li class="js_mycollect">收藏</li>
													<div class="spacile_aa">添加到歌单</div>
													<ul class="js_gedanda">
														<li class="js_gedan">暂无自定义歌单</li>
													</ul>
												</ul>
											</div>
										</a>
									</div>
								</div>
								<div class="songlist_header_list songlist_header_person song_cursor js_autor">${ songArr1[i].autor}</div>
								<div class="songlist_header_list songlist_header_time js_time" id="">${songArr1[i].time}</div>
							</div>
						</li>
						`;
					};
					$(".js_songlistheader").html(html);
					//检查音乐是否已经喜欢，添加爱心
					for(var i = 0,len= songArr1.length; i<len;i++){
						var index = i;
						var islove = songArr1[index].islove;
						if(islove == 1){
							$(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find('.js_lover i').removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)");
							$(".js_songlistheadersmall").find(`.js_songlismall[data-index=${index}]`).find('.js_lover i').removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)");
							//小播放界面爱心不能添加
							$(".js_loverfoot").find('i').removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)");

						}
					}
					//存储搜索所需要的lidoms
					this.saerchDoms = Array.from($("#js_idsonglist").find(".js_songli"))
					songArr1.map(m=>{
					   arrSrc.push(m.src);
					});
					playerMusic.addMusic(arrSrc);
					$('input').iCheck('destroy');
					$('input').iCheck({
						checkboxClass: 'icheckbox_square-pink',
						radioClass: 'iradio_square-pink',
					});

                },
                // 列表歌曲数据显示 传入相应的数组
                loadDate(){
                    /*
                    	--歌曲参数详情--
                        id: "1",
                        name: "歌曲名",
                        src: "歌曲文件地址",
                        autor: "歌手",
                        key："歌词文本"（lrc格式文本）
                        time:"10:10"（分：秒格式歌曲时长）
                        album: "专辑名"
                        islove: 1/0 (登录后歌曲带的属性，判断歌曲是否存在喜欢列表中，1表示存在，0表示不存在)
                    */
                    var $this = this;

                    $(".loading_img").show();
                    //异步处理
                    //请求成功加载到总的音乐数组中
                    //这里的this.songArr充当请求回来的数据
					$(".loading_img").hide();
                       	var addsongArr = [];
                    	$.ajax({
                    		url : "music/select/selectallmusic",
                    		data : null,
                    		dataType : null,
                    		type : "post",
                    		success : function(data) {
                    			var musiclist = data.rows;
                    			var songArr1 = new Array();
                    			for (var music of musiclist) {
                    				var duration = Math.floor(music.duration/60);
                    				var durationadd = music.duration%60;
                    			    if (music.duration%60 < 10){
                    			    	durationadd = "0"+ music.duration%60;
                    			    }
                    			    var time = duration +":"+ durationadd;
                    				var songs = {
                    					id: music.sid,
                    					name: music.song_name,
                    					src: "music/play/stream?sid="+music.sid,
                    					autor: music.author,
                    					time: time,
                    					key: music.key,
                                        album: music.album
                    				};
                    				songArr1.push(songs);
                    			}

                    			addsongArr.push(songArr1);
                    			$this.listLoad(songArr1);
                                //歌词页面列表加载
                                $this.tableinit(songArr1);

                                //小窗口初始化
                                var num = musiclist.length;
                                $(".js_songtotle").html(num);
								addGedanda();

                    		},
                    		error : function(data) {
                                $this.tip("获取列表出错啦(ŎдŎ；)");
                    		}
                    	});
                },
                //列表点击显示的列表栏
                showListsong(){
                	var $this = this;
                	//全部歌曲
                	$(".js_palylistsong").on("click",".js_playall",function(){
						if ( isLogin == true) {
                            $(".left_li").removeClass("focus");
                            $(".js_playall").addClass("focus");
                			$(".loading_img").show();
                            $(".loading_img").hide();
                			//ajax
                			var addsongArr = [];
                			$.ajax({
                        		url : "music/select/selectloginallmusic",
                        		data : null,
                        		dataType : null,
                        		type : "post",
                        		success : function(data) {
                        			var musiclist = data.rows;
                        			console.log(musiclist);
                        			var songArr1 = new Array();
                        			for (var music of musiclist) {
                        				var duration = Math.floor(music.duration/60);
                        				var durationadd = music.duration%60;
                        			    if (music.duration%60 < 10){
                        			    	durationadd = "0"+ music.duration%60;
                        			    }
                        			    var time = duration +":"+ durationadd;
                        				var songs = {
                        					id: music.sid,
                        					name: music.song_name,
                        					src: "music/play/stream?sid="+music.sid,
                        					autor: music.author,
                        					time: time,
                        					key: music.key,
                                            album: music.album,
											islove: music.islove
                        				};
                        				songArr1.push(songs);
                        			}

                        			addsongArr.push(songArr1);
									$this.lrcloadDate(songArr1);
                        			$this.listLoad(songArr1);
                                    //歌词页面列表加载
                                    // $this.tableinit(songArr1);
									$this.songinfoinit(songArr1);
                                    $("#logindelete").hide();

                                    //小窗口初始化
                                    var num = musiclist.length;
                                    $(".js_songtotle").html(num);
									addGedanda();
                        		},
                        		error : function(data) {
                                    $this.tip("获取列表出错啦(ŎдŎ；)");
                        		}
                        	});
						}else{
							$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ");
						}
					})

                	//播放历史
                	$(".js_palylistsong").on("click",".js_playhistory",function(){
							if ( isLogin == true) {
                                $(".left_li").removeClass("focus");
                                $(".js_playhistory").addClass("focus");
								$(".loading_img").show();
								$(".loading_img").hide();
								//ajax
								var addsongArr = [];
								$.ajax({
									url : "music/select/selecthistorymusic",
									data : null,
									dataType : null,
									type : "post",
									success : function(data) {
										var musiclist = data.rows;
										console.log(musiclist);
										if (musiclist.length == 0){
										    $this.tip("暂时还没有歌曲呢~")
                                        }
										$('.js_songli').find(".js_stop i").removeClass("icon-xinzanting").addClass("icon-xinzanting1");
                                        // console.log($('.js_songli').find(".js_stop i").hasClass("icon-xinzanting"))
                                        var musiclist = data.rows;
										var songArr1 = new Array();
										for (var music of musiclist) {
											var duration = Math.floor(music.duration/60);
											var durationadd = music.duration%60;
											if (music.duration%60 < 10){
												durationadd = "0"+ music.duration%60;
											}
											var time = duration +":"+ durationadd;
											var songs = {
												id: music.sid,
												name: music.song_name,
												src: "music/play/stream?sid="+music.sid,
												autor: music.author,
												time: time,
												key: music.key,
                                                album: music.album,
												islove: music.islove
											};
											songArr1.push(songs);
										}
										addsongArr.push(songArr1);
										//底部footer列表点击加载歌曲
										$this.lrcloadDate(songArr1);
										$this.listLoad(songArr1);
										//歌词页面列表加载
										// $this.tableinit(songArr1);
										// $("#logindelete").show();
										$this.songinfoinit(songArr1);
										$("#logindelete").hide();
										var num = musiclist.length;
										$(".js_songtotle").html(num);
										addGedanda();
									},
									error : function(data) {
										$this.tip("获取列表出错啦(ŎдŎ；)");
									}
								});

							}else{
								$(".left_li").removeClass("focus")
								$(".js_playall").addClass("focus");
								$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ");
							}
                		})
                	//我喜欢
                	$(".js_palylistsong").on("click",".js_playmylover",function(){
						if ( isLogin == true) {
                            $(".left_li").removeClass("focus");
                            $(".js_playmylover").addClass("focus");
                			$(".loading_img").show();
                            $(".loading_img").hide();
                			//ajax
                			var addsongArr = [];
                			$.ajax({
                        		url : "music/select/selectlikemusic",
                        		data : null,
                        		dataType : null,
                        		type : "post",
                        		success : function(data) {
                        			var musiclist = data.rows;
                        			console.log(musiclist);
                                    if (musiclist.length == 0){
                                        $this.tip("暂时还没有歌曲呢~")
                                    }
                        			var songArr1 = new Array();
                        			for (var music of musiclist) {
                        				var duration = Math.floor(music.duration/60);
                        				var durationadd = music.duration%60;
                        			    if (music.duration%60 < 10){
                        			    	durationadd = "0"+ music.duration%60;
                        			    }
                        			    var time = duration +":"+ durationadd;
                        				var songs = {
                        					id: music.sid,
                        					name: music.song_name,
                        					src: "music/play/stream?sid="+music.sid,
                        					autor: music.author,
                        					time: time,
                        					key: music.key,
                                            album: music.album,
											islove: music.islove
                        				};
                        				songArr1.push(songs);
                        			}

                        			addsongArr.push(songArr1);
									$this.lrcloadDate(songArr1);
									//列表点击加载歌曲注释
                        			$this.listLoad(songArr1);
                                    //歌词页面列表加载
                                    //$this.tableinit(songArr1);
									$this.songinfoinit(songArr1);
                                    $("#logindelete").show();

                                    var num = musiclist.length;
                                    $(".js_songtotle").html(num);
									addGedanda();
                        		},
                        		error : function(data) {
									$this.tip("获取列表出错啦(ŎдŎ；)");
                        		}

                        	});

                        }else{
                        	$(".left_li").removeClass("focus")
                        	$(".js_playall").addClass("focus");
                        	$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ");
                        }

                		})

                	//收藏
                	$(".js_palylistsong").on("click",".js_playcollection",function(){
                			if ( isLogin == true) {
                            $(".left_li").removeClass("focus");
                            $(".js_playcollection").addClass("focus");
                			$(".loading_img").show();
                            $(".loading_img").hide();
                			//ajax
                			var addsongArr = [];
                			$.ajax({
                        		url : "music/select/selectcollectionmusic",
                        		data : null,
                        		dataType : null,
                        		type : "post",
                        		success : function(data) {
                        			var musiclist = data.rows;
                        			console.log(musiclist);
                                    if (musiclist.length == 0){
                                        $this.tip("暂时还没有歌曲呢~")
                                    }
                        			var songArr1 = new Array();
                        			for (var music of musiclist) {
                        				var duration = Math.floor(music.duration/60);
                        				var durationadd = music.duration%60;
                        			    if (music.duration%60 < 10){
                        			    	durationadd = "0"+ music.duration%60;
                        			    }
                        			    var time = duration +":"+ durationadd;
                        				var songs = {
                        					id: music.sid,
                        					name: music.song_name,
                        					src: "music/play/stream?sid="+music.sid,
                        					autor: music.author,
                        					time: time,
                        					key: music.key,
                                            album: music.album,
											islove: music.islove
                        				};
                        				songArr1.push(songs);
                        			}

                        			addsongArr.push(songArr1);
                        			$this.listLoad(songArr1);
                                    //歌词页面列表加载
                                    //$this.tableinit(songArr1);
									$this.songinfoinit(songArr1);
									$this.lrcloadDate(songArr1)
									$("#logindelete").show();

                                    var num = musiclist.length;
                                    $(".js_songtotle").html(num);
									addGedanda();
                        		},
                        		error : function(data) {
									$this.tip("获取列表出错啦(ŎдŎ；)");
                        		}

                        	});

                			}else{
                				$(".left_li").removeClass("focus")
                				$(".js_playall").addClass("focus");
                        		$this.tip("小伙伴忘记登录啦(≧∇≦)ﾉ");
                        	}
                		})

					//点击查询自定义歌单歌曲列表
					$(".js_songlist").on("click",".left_li",function(){
						if($(".left_li").hasClass("focus")){
                            //focus切换
                            $(".left_li").removeClass("focus");
                            $(this).addClass("focus");
                            // 获取到点击的自定义歌单的id
                            // alert($(this).find("#customlist_id").attr("value"));
							var lid = $(this).find("#customlist_id").attr("value");
							$(".loading_img").show();
							$(".loading_img").hide();
							//ajax
							var addsongArr = [];
							$.ajax({
								url : "music/customlist/selectcustomlistmusic",
								data : {lid:lid},
								dataType : null,
								type : "post",
								success : function(data) {
									var musiclist = data.rows;
									console.log(musiclist);
                                    if (musiclist.length == 0){
                                        $this.tip("暂时还没有歌曲呢~")
                                    }
									var songArr1 = new Array();
									for (var music of musiclist) {
										var duration = Math.floor(music.duration/60);
										var durationadd = music.duration%60;
										if (music.duration%60 < 10){
											durationadd = "0"+ music.duration%60;
										}
										var time = duration +":"+ durationadd;
										var songs = {
											id: music.sid,
											name: music.song_name,
											src: "music/play/stream?sid="+music.sid,
											autor: music.author,
											time: time,
											key: music.key,
                                            album: music.album,
											islove: music.islove
										};
										songArr1.push(songs);
									}
									addsongArr.push(songArr1);
									$this.listLoad(songArr1);
									//歌词页面列表加载
									//$this.tableinit(songArr1);
									$this.songinfoinit(songArr1);
									$("#logindelete").show();

									var num = musiclist.length;
									$(".js_songtotle").html(num);
									addGedanda();

								},
								error : function(data) {
									$this.tip("获取列表出错啦(ŎдŎ；)");
								}
							});

						}
					})

                },
				//检查更新音乐最后播放时间
				checkMusic: function(songId){
                    //只有平台具有登录状态才能够更新统计音乐播放次数
					if ( isLogin == true) {
						$.ajax({
							url : "music/user/playmusic",
							data : {songid:songId},
							dataType : "json",
							type : "post",
							success : function(data) {
								// console.log(data.result);
							},
							error: function (data) {
								// console.log("error");
							}
						});
					}
				},
                //提示框
                tip(text){
                    var bomb = $(".js_bombword").html(text);
                    $(".js_bombpromt").fadeIn().stop(true,true);
                    setTimeout(function(e){
                        $(".js_bombpromt").fadeOut();
                    },1500);
                },
                //搜索 模糊查找
                searchInfo(){
                    var $this = this;
                    $(".js_searchInput").on("input",function(){
                        let val  = $(this).val();
                        let findDoms = $this.saerchDoms.filter(function(dom,index){
                            if($(dom).find(".js_listname").text().indexOf(val)!=-1){
                                return dom;
                            }
                        })
                        if(findDoms.length>0){
                            $("#js_idsonglist").find(".js_songli").remove();
                            $("#js_idsonglist").append(findDoms)
                        }

                    })
                },
                //checkbox的选择
                checkSong(){
                    $(".js_Songcheck").on("ifChecked","#allOptionId",function(e){
                        $('input').iCheck('check');
                    })
                    $(".js_Songcheck").on("ifUnchecked","#allOptionId",function(e){
                        $('input').iCheck('uncheck');
                    })
                },
                //歌词页面播放列表
                lrcloadDate(lrcsongArr){
                    var $this = this;
                    var lrcarrSrc = [];
                    var lrcarSong = [];
                    setTimeout(function(){
                        var lrchtml = "";
                        for(var i=0,len=lrcsongArr.length;i<len;i++){
                            lrchtml += `

                            <li class="player_list_li js_songli js_songlismall  js_songlismalltest"  data-index="${i}" data-songid="${lrcsongArr[i].id}">
                                <div class="js_listcontent js_listnum" style="position: relative";>
                                    <img src="img/player-list.png" alt="" height="15" style="position: absolute;top:0px;left: -7px;display:none;" class="js_samllimgstop">
                                    <img src="img/player-list.gif" alt="" height="15" style="position: absolute;top:0px;left: -7px;display:none;" class="js_samllimg">
                                    <div class="player_song_title music_info">
                                        <div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 245px"><h3>${lrcsongArr[i].name}</h3></div>
                                        <p>${lrcsongArr[i].autor}</p>
                                    </div>
                                    <div class="player_song_iconfont music_info js_songtools" id="playericon" style="display:none;">
                                        <a href="javascript:;" class="tuzi1 js_stop" id="test_d" style="font-size: 15px !important; top:10px;"><i class="iconfont icon-xinzanting1"></i></a>

                                        <a href="javascript:;" class="js_lover loverfooter"  id="lover" data-id="${lrcsongArr[i].id}"> <i class="iconfont icon-aixinkong1"></i></a>
                                    </div>
                                    <div class="player_song_time music_info js_lrctime">
                                        <span>${lrcsongArr[i].time}</span>
                                    </div>
                                </div>
                            </li>
                            `
                        }
                        $(".js_bofanglist").html(lrchtml);
                    },10)
                },
                //歌词解析
                //歌词滚动功能
                lrc(addarr,index){
                    var $this = this;
					 if(addarr[index].key){
						 var arraysNew = addarr[index].key.split("[");
						 var len = arraysNew.length;
						 var contentLrc = [];
						 var lrcHtml = "";
						 for(var i=0;i<len;i++) {
							 var temp = arraysNew[i];
							 //根据分号分割过滤数据(replace() 方法用于在字符串中用一些字符替换另一些字符，或替换一个与正则表达式匹配的子串。)
							 var tempNum = temp.split("]")[0].split(".")[0];
							 var time = parseInt(tempNum.split(":")[0])*60 + parseInt(tempNum.split(":")[1]);
							 var tempWord = temp.split("]")[1];
							 if(tempWord==null){
								 tempWord = " "
							 }
							 lrcHtml += `<p data-time="${time}">${tempWord}</p>`
						 };
						 $(".js_lrc").html(lrcHtml)
						 $this.songLrcContent.push(contentLrc);
					 }else{
					 	lrcHtml = `<p >暂无歌词信息</p>`;
					 	$(".js_lrc").html(lrcHtml);
						 // $(".js_lrc").html("暂无歌词信息");
					 }
				},
                //高亮显示（音乐播放时长）
                timeInit(){
                    var $setThis = this;
                    playerMusic.percent(function(){
                        $(".js_pre").css({
                            width:  this.per + "%"
                        });
                        $(".js_prevalue").css({
                            left:  this.per + "%"
                        })
						if(timeMark){
							//不停的更新音乐播放状态
							$(".timestar").html(this.durationtest);
							$(".timeend").html(this.stime);

						}
                        var newStime = parseInt(this.stime.split(":")[0])*60 + parseInt(this.stime.split(":")[1])
                        $(".js_lrc").find("p").each(function(index,dom){
                            if(newStime >= $(".js_lrc").find("p").eq(index).data("time")&&newStime < $(".js_lrc").find("p").eq(index+1).data("time")){
                                $(".js_lrc").find("p").eq(index).addClass("blingbling");
                                //滚筒条联动 歌词联动
                                if($(dom).get(0).offsetTop>$(".js_lrc").height()/2){
                                    $(".js_lrc").animate({scrollTop:$(dom).get(0).offsetTop - $(".js_lrc").height()/4},250);
                                }
                                //
                            }else{
                                $(".js_lrc").find("p").eq(index).removeClass("blingbling")
                            }
                        })
						//当歌曲播放完毕进行背景页面切换
						if(this.durationtest==this.stime){
							//imgChangeCheck 控制该方法多次调用只执行一次
							imgChangeCheck = imgChangeCheck+1;
							if (imgChangeCheck==1){
								setTimeout(function () {
									//除了背景进行更换，播放音乐的专辑图片也进行更换
									var i = $setThis.preIndex;
									var songId = $('.js_songli').eq(i).data("songid");
									$setThis.checkMusic(songId);
									$(".js_foodimgshow").attr("src","music/imge/show?songId="+songId);
									$("#image").attr("src","music/imge/show?songId="+songId);
									$setThis.changeImg(songId);
									imgChangeCheck = 0;
								},1400);
							}

						}
                    })
                },
            //播放功能块
                //播放切换背景图方法
                changeImg(sid){
                    $(".bg-img").animate({opcity:"0"});
                    $.ajax({
                        url : "music/play/filename",
                        data : {
                            sid:sid,
                        },
                        dataType : "json",
                        type : "post",
                        success : function(data) {
                            var fileinfo = data.rows[0];
                            var filename = fileinfo.file_name;
                            if (fileinfo.img != null ){
                                // console.log(fileinfo.img);
                                var imgpath = "http://134.175.87.165:8080/bgimg/"+filename+".jpg";
                                $(".bg-img").css("background-image","url('"+imgpath+"')").animate({opcity:"1"});
                            }else {
                            	var num = parseInt(Math.random()*localimgs.length);
								// $(".bg-img").css("background-image","url('./img/CMF.jpg')");
								$(".bg-img").css("background-image","url('./img/bgimg/"+localimgs[num]+"')");
                            }
                        },
                        error : function(data) {
                            // console.log("fail")
                        }
                    });
                },
                //上一首切换
                prPrev(){
                    var $this = this;
                    $(".icon-youbofang-copy-copy").click(function(){
                        playerMusic.nextIndex("pre");
						var i = $this.preIndex;
                        var songId = $('.js_songli').eq(i).data("songid");
//						console.log("test bofang up:"+songId);
						$this.checkMusic(songId);
                        $(".js_foodimgshow").attr("src","music/imge/show?songId="+songId);
                        $("#image").attr("src","music/imge/show?songId="+songId);
                        //上一首歌曲的图片切换展示
                        $this.changeImg(songId);
                        //$('.js_songli').eq(i).find(".js_stop i").removeClass("icon-xinzanting1").addClass("icon-xinzanting");
                        })
                },
                //下一首切换
                next(){
                	var $this = this;
                    $(".icon-youbofang").click(function(){
                        playerMusic.nextIndex("next");
                        var i = $this.preIndex;
                        var songId = $('.js_songli').eq(i).data("songid");
						$this.checkMusic(songId);
                        $(".js_foodimgshow").attr("src","music/imge/show?songId="+songId);
                        $("#image").attr("src","music/imge/show?songId="+songId);
                        //下一首歌曲的图片切换展示
                        $this.changeImg(songId);
                    })
                },
                //底部播放联动列表播放暂停
                //暂停播放切换
                togglePlay(arr,tag){
					//暂停播放
					var flag = true;
					var $this = this;
					$(".js_songlistheader").on("click",".js_stop",function(e){
						// console.log($(this).find(".iconfont-xinzangting"));
						var indexLi = $(this).closest(".js_songli").data("index");
						var indexId = $(this).closest(".js_songli").data("songid");
						var indexNum = $(".js_footestop").data("index");
						$this.lrc(arr,indexLi);
						if(tag == 0){
							$(".js_footestop").data("index",indexLi);
							$(".js_footestop").data("id",indexId);
							if(indexLi == indexNum){
								if($(this).find("i").hasClass("icon-xinzanting1")){
									$(".js_footestop").trigger("click");
								}else{
									$(".js_footestop").trigger("click");
								}
							}else{
								playerMusic.player(indexLi);
								$(".js_footestop").trigger("click");
								$(".js_foodimgshow").attr("src","music/imge/show?songId="+indexId);
								$("#image").attr("src","music/imge/show?songId="+indexId);
							}
							//喜欢
							if($(this).parent().parent().find(".js_lover i").hasClass("icon-aixin1")){
								$(".js_loverfoot").find("i").removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)")
							}else{
								$(".js_loverfoot").find("i").removeClass("icon-aixin1").addClass("icon-aixinkong1").css("color","#c3c3c3")
							};
						}


					}) ;
                },
                //播放暂停
                stopPlay(){
                    var $this = this;
                    $(".js_footestop").on("click",function(e){
                        var indexNum = $(this).data("index");
                        $this.initFootPlayer(indexNum)
						var songId = $('.js_songli').eq(indexNum).data("songid");
                        if($(this).find("i").hasClass("icon-xinzanting1") || $(".js_songlismall").eq(indexNum).find(".js_stop i").hasClass("icon-xinzanting1")){
                            $this.changeIcon(indexNum,"play");
							$this.checkMusic(songId);
                            playerMusic.play();
                            //播放时更换背景图片
                            $this.changeImg(songId);
                        }else{
                            $this.changeIcon(indexNum,"stop");
                            playerMusic.stop();
                        }
                    });
                    $(".js_lrcstop").on("click",function(){
                        $(".js_footestop").trigger("click");

                    });
                },
                //双击播放
                doublePlayer(arr,tag){
					var $this = this;
					$(".js_songlistheader").on("dblclick",".js_songli",function(){
						var indexLi = $(this).data("index");
						$this.lrc(arr,indexLi);
						var textSongname = $(this).find(".js_listname").text();
						var textSonger = $(this).find(".js_autor").text();
						var songId = $(this).find(".js_lover").data("id");
						if(tag == 0){
							$(".js_footestop").data("index",$(this).data("index"));
							playerMusic.player($(this).data("index"));
							// $(this).find(".js_stop i").removeClass("icon-xinzanting1").addClass("icon-xinzanting");
							// $(".js_footestop i").removeClass("icon-xinzanting1").addClass("icon-xinzanting");
							// $(".js_songname").text(textSongname);
							// $(".js_songsonger").text(textSonger);
							$(".js_footestop").trigger("click");
							$(".js_foodimgshow").attr("src","music/imge/show?songId="+songId);
							$("#image").attr("src","music/imge/show?songId="+songId);
							//当前歌曲的图片展示功能ajax
							if($(this).find(".js_lover i").hasClass("icon-aixinkong1")){
								$(".js_loverfoot").find("i").removeClass("icon-aixin1").addClass("icon-aixinkong1").css("color","#c3c3c3")
							}else{
								$(".js_loverfoot").find("i").removeClass("icon-aixinkong1").addClass("icon-aixin1").css("color","rgba(247, 59, 59, 0.8)")
							};
						}
					})
					$(".js_songlistheader").on("dblclick",".js_xiangxixi",function(e){
						e.stopPropagation();
					})
                },
                changeIcon(index,state){
                    if(state == "stop"){

                        $(".js_footestop i").removeClass("icon-xinzanting").addClass("icon-xinzanting1");
                        $(".js_lrcstop i").removeClass("icon-xinzanting").addClass("icon-xinzanting1");
                        $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_stop i").removeClass("icon-xinzanting").addClass("icon-xinzanting1");
                        $(".js_songli").find(".js_samllimg").hide();
                        $(".js_songli").find(".js_samllimgstop").hide();
                        $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_samllimgstop").show();
                    };
                    if(state == "play"){

                        $(".js_footestop i").removeClass("icon-xinzanting1").addClass("icon-xinzanting");
                        $(".js_lrcstop i").removeClass("icon-xinzanting1").addClass("icon-xinzanting");
                        $('.js_songli').find(".js_stop i").removeClass("icon-xinzanting").addClass("icon-xinzanting1");
                        $('.js_songlismall').find(".js_stop i").removeClass("icon-xinzanting").addClass("icon-xinzanting1");
                        $(".js_songli").removeClass("newactive")
                        $(".js_songli").find(".js_samllimg").hide();
                        $(".js_songli").find(".js_samllimgstop").hide();

                        $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_samllimg").show();
                        $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).addClass("newactive")
                        $(".js_songlistheader").find(`.js_songli[data-index=${index}]`).find(".js_stop i").removeClass("icon-xinzanting1").addClass("icon-xinzanting");
                    }

                }
            };
            ajaxInfo.init();
            //加载方法


            //页面底部
        });
    </script>

	<!--&lt;!&ndash;系统看板娘&ndash;&gt;-->
	<!--&lt;!&ndash; 实现拖动效果，需引入 JQuery UI &ndash;&gt;-->
	<!--<script type="text/javascript" src="js/live2d/jquery-ui.min.js"></script>-->
	<!--&lt;!&ndash; 使用 aotuload.js 引入看板娘 &ndash;&gt;-->
	<!--<script type="text/javascript" src="js/live2d/autoload.js"></script>-->

</body>
</html>